3.9.84 \(\int \frac {(d \cot (e+f x))^n}{(a+b \tan (e+f x))^2} \, dx\) [884]

Optimal. Leaf size=250 \[ -\frac {a^2 (d \cot (e+f x))^{3+n}}{b \left (a^2+b^2\right ) d^3 f (b+a \cot (e+f x))}+\frac {\left (a^2-b^2\right ) (d \cot (e+f x))^{3+n} \, _2F_1\left (1,\frac {3+n}{2};\frac {5+n}{2};-\cot ^2(e+f x)\right )}{\left (a^2+b^2\right )^2 d^3 f (3+n)}+\frac {a^2 \left (b^2 n+a^2 (2+n)\right ) (d \cot (e+f x))^{3+n} \, _2F_1\left (1,3+n;4+n;-\frac {a \cot (e+f x)}{b}\right )}{b^2 \left (a^2+b^2\right )^2 d^3 f (3+n)}+\frac {2 a b (d \cot (e+f x))^{4+n} \, _2F_1\left (1,\frac {4+n}{2};\frac {6+n}{2};-\cot ^2(e+f x)\right )}{\left (a^2+b^2\right )^2 d^4 f (4+n)} \]

[Out]

-a^2*(d*cot(f*x+e))^(3+n)/b/(a^2+b^2)/d^3/f/(b+a*cot(f*x+e))+(a^2-b^2)*(d*cot(f*x+e))^(3+n)*hypergeom([1, 3/2+
1/2*n],[5/2+1/2*n],-cot(f*x+e)^2)/(a^2+b^2)^2/d^3/f/(3+n)+a^2*(b^2*n+a^2*(2+n))*(d*cot(f*x+e))^(3+n)*hypergeom
([1, 3+n],[4+n],-a*cot(f*x+e)/b)/b^2/(a^2+b^2)^2/d^3/f/(3+n)+2*a*b*(d*cot(f*x+e))^(4+n)*hypergeom([1, 2+1/2*n]
,[3+1/2*n],-cot(f*x+e)^2)/(a^2+b^2)^2/d^4/f/(4+n)

________________________________________________________________________________________

Rubi [A]
time = 0.55, antiderivative size = 250, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 8, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3754, 3650, 3734, 3619, 3557, 371, 3715, 66} \begin {gather*} \frac {2 a b (d \cot (e+f x))^{n+4} \, _2F_1\left (1,\frac {n+4}{2};\frac {n+6}{2};-\cot ^2(e+f x)\right )}{d^4 f (n+4) \left (a^2+b^2\right )^2}+\frac {\left (a^2-b^2\right ) (d \cot (e+f x))^{n+3} \, _2F_1\left (1,\frac {n+3}{2};\frac {n+5}{2};-\cot ^2(e+f x)\right )}{d^3 f (n+3) \left (a^2+b^2\right )^2}+\frac {a^2 \left (a^2 (n+2)+b^2 n\right ) (d \cot (e+f x))^{n+3} \, _2F_1\left (1,n+3;n+4;-\frac {a \cot (e+f x)}{b}\right )}{b^2 d^3 f (n+3) \left (a^2+b^2\right )^2}-\frac {a^2 (d \cot (e+f x))^{n+3}}{b d^3 f \left (a^2+b^2\right ) (a \cot (e+f x)+b)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d*Cot[e + f*x])^n/(a + b*Tan[e + f*x])^2,x]

[Out]

-((a^2*(d*Cot[e + f*x])^(3 + n))/(b*(a^2 + b^2)*d^3*f*(b + a*Cot[e + f*x]))) + ((a^2 - b^2)*(d*Cot[e + f*x])^(
3 + n)*Hypergeometric2F1[1, (3 + n)/2, (5 + n)/2, -Cot[e + f*x]^2])/((a^2 + b^2)^2*d^3*f*(3 + n)) + (a^2*(b^2*
n + a^2*(2 + n))*(d*Cot[e + f*x])^(3 + n)*Hypergeometric2F1[1, 3 + n, 4 + n, -((a*Cot[e + f*x])/b)])/(b^2*(a^2
 + b^2)^2*d^3*f*(3 + n)) + (2*a*b*(d*Cot[e + f*x])^(4 + n)*Hypergeometric2F1[1, (4 + n)/2, (6 + n)/2, -Cot[e +
 f*x]^2])/((a^2 + b^2)^2*d^4*f*(4 + n))

Rule 66

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[c^n*((b*x)^(m + 1)/(b*(m + 1)))*Hypergeometr
ic2F1[-n, m + 1, m + 2, (-d)*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[m] && (IntegerQ[n] || (GtQ[
c, 0] &&  !(EqQ[n, -2^(-1)] && EqQ[c^2 - d^2, 0] && GtQ[-d/(b*c), 0])))

Rule 371

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*((c*x)^(m + 1)/(c*(m + 1)))*Hyperg
eometric2F1[-p, (m + 1)/n, (m + 1)/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 3557

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[b/d, Subst[Int[x^n/(b^2 + x^2), x], x, b*Tan[c + d
*x]], x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 3619

Int[((b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*T
an[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Tan[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x] && NeQ
[c^2 + d^2, 0] &&  !IntegerQ[2*m]

Rule 3650

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[b^2*(a + b*Tan[e + f*x])^(m + 1)*((c + d*Tan[e + f*x])^(n + 1)/(f*(m + 1)*(a^2 + b^2)*(b*c - a*d))), x] + D
ist[1/((m + 1)*(a^2 + b^2)*(b*c - a*d)), Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[a*(b*c -
 a*d)*(m + 1) - b^2*d*(m + n + 2) - b*(b*c - a*d)*(m + 1)*Tan[e + f*x] - b^2*d*(m + n + 2)*Tan[e + f*x]^2, x],
 x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && I
ntegerQ[2*m] && LtQ[m, -1] && (LtQ[n, 0] || IntegerQ[m]) &&  !(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] &&
NeQ[a, 0])))

Rule 3715

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_) + (C_.)*
tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[A/f, Subst[Int[(a + b*x)^m*(c + d*x)^n, x], x, Tan[e + f*x]], x]
 /; FreeQ[{a, b, c, d, e, f, A, C, m, n}, x] && EqQ[A, C]

Rule 3734

Int[(((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (
f_.)*(x_)]^2))/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/(a^2 + b^2), Int[(c + d*Tan[e + f*
x])^n*Simp[b*B + a*(A - C) + (a*B - b*(A - C))*Tan[e + f*x], x], x], x] + Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 +
b^2), Int[(c + d*Tan[e + f*x])^n*((1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x])), x], x] /; FreeQ[{a, b, c, d, e,
f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] &&  !GtQ[n, 0] &&  !LeQ[n, -
1]

Rule 3754

Int[(cot[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_.))^(p_.), x_Symbol] :> Dist
[d^(n*p), Int[(d*Cot[e + f*x])^(m - n*p)*(b + a*Cot[e + f*x]^n)^p, x], x] /; FreeQ[{a, b, d, e, f, m, n, p}, x
] &&  !IntegerQ[m] && IntegersQ[n, p]

Rubi steps

\begin {align*} \int \frac {(d \cot (e+f x))^n}{(a+b \tan (e+f x))^2} \, dx &=\frac {\int \frac {(d \cot (e+f x))^{2+n}}{(b+a \cot (e+f x))^2} \, dx}{d^2}\\ &=-\frac {a^2 (d \cot (e+f x))^{3+n}}{b \left (a^2+b^2\right ) d^3 f (b+a \cot (e+f x))}-\frac {\int \frac {(d \cot (e+f x))^{2+n} \left (-d \left (b^2-a^2 (2+n)\right )+a b d \cot (e+f x)+a^2 d (2+n) \cot ^2(e+f x)\right )}{b+a \cot (e+f x)} \, dx}{b \left (a^2+b^2\right ) d^3}\\ &=-\frac {a^2 (d \cot (e+f x))^{3+n}}{b \left (a^2+b^2\right ) d^3 f (b+a \cot (e+f x))}-\frac {\int (d \cot (e+f x))^{2+n} \left (b \left (a^2-b^2\right ) d+2 a b^2 d \cot (e+f x)\right ) \, dx}{b \left (a^2+b^2\right )^2 d^3}-\frac {\left (a^2 \left (b^2 n+a^2 (2+n)\right )\right ) \int \frac {(d \cot (e+f x))^{2+n} \left (1+\cot ^2(e+f x)\right )}{b+a \cot (e+f x)} \, dx}{b \left (a^2+b^2\right )^2 d^2}\\ &=-\frac {a^2 (d \cot (e+f x))^{3+n}}{b \left (a^2+b^2\right ) d^3 f (b+a \cot (e+f x))}-\frac {(2 a b) \int (d \cot (e+f x))^{3+n} \, dx}{\left (a^2+b^2\right )^2 d^3}-\frac {\left (a^2-b^2\right ) \int (d \cot (e+f x))^{2+n} \, dx}{\left (a^2+b^2\right )^2 d^2}-\frac {\left (a^2 \left (b^2 n+a^2 (2+n)\right )\right ) \text {Subst}\left (\int \frac {(-d x)^{2+n}}{b-a x} \, dx,x,-\cot (e+f x)\right )}{b \left (a^2+b^2\right )^2 d^2 f}\\ &=-\frac {a^2 (d \cot (e+f x))^{3+n}}{b \left (a^2+b^2\right ) d^3 f (b+a \cot (e+f x))}+\frac {a^2 \left (b^2 n+a^2 (2+n)\right ) (d \cot (e+f x))^{3+n} \, _2F_1\left (1,3+n;4+n;-\frac {a \cot (e+f x)}{b}\right )}{b^2 \left (a^2+b^2\right )^2 d^3 f (3+n)}+\frac {(2 a b) \text {Subst}\left (\int \frac {x^{3+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{\left (a^2+b^2\right )^2 d^2 f}+\frac {\left (a^2-b^2\right ) \text {Subst}\left (\int \frac {x^{2+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{\left (a^2+b^2\right )^2 d f}\\ &=-\frac {a^2 (d \cot (e+f x))^{3+n}}{b \left (a^2+b^2\right ) d^3 f (b+a \cot (e+f x))}+\frac {\left (a^2-b^2\right ) (d \cot (e+f x))^{3+n} \, _2F_1\left (1,\frac {3+n}{2};\frac {5+n}{2};-\cot ^2(e+f x)\right )}{\left (a^2+b^2\right )^2 d^3 f (3+n)}+\frac {a^2 \left (b^2 n+a^2 (2+n)\right ) (d \cot (e+f x))^{3+n} \, _2F_1\left (1,3+n;4+n;-\frac {a \cot (e+f x)}{b}\right )}{b^2 \left (a^2+b^2\right )^2 d^3 f (3+n)}+\frac {2 a b (d \cot (e+f x))^{4+n} \, _2F_1\left (1,\frac {4+n}{2};\frac {6+n}{2};-\cot ^2(e+f x)\right )}{\left (a^2+b^2\right )^2 d^4 f (4+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.89, size = 192, normalized size = 0.77 \begin {gather*} -\frac {\cot ^3(e+f x) (d \cot (e+f x))^n \left (b^2 \left (-a^2+b^2\right ) (4+n) \, _2F_1\left (1,\frac {3+n}{2};\frac {5+n}{2};-\cot ^2(e+f x)\right )+a \left (2 a b^2 (4+n) \, _2F_1\left (1,3+n;4+n;-\frac {a \cot (e+f x)}{b}\right )-2 b^3 (3+n) \cot (e+f x) \, _2F_1\left (1,\frac {4+n}{2};\frac {6+n}{2};-\cot ^2(e+f x)\right )+a \left (a^2+b^2\right ) (4+n) \, _2F_1\left (2,3+n;4+n;-\frac {a \cot (e+f x)}{b}\right )\right )\right )}{b^2 \left (a^2+b^2\right )^2 f (3+n) (4+n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d*Cot[e + f*x])^n/(a + b*Tan[e + f*x])^2,x]

[Out]

-((Cot[e + f*x]^3*(d*Cot[e + f*x])^n*(b^2*(-a^2 + b^2)*(4 + n)*Hypergeometric2F1[1, (3 + n)/2, (5 + n)/2, -Cot
[e + f*x]^2] + a*(2*a*b^2*(4 + n)*Hypergeometric2F1[1, 3 + n, 4 + n, -((a*Cot[e + f*x])/b)] - 2*b^3*(3 + n)*Co
t[e + f*x]*Hypergeometric2F1[1, (4 + n)/2, (6 + n)/2, -Cot[e + f*x]^2] + a*(a^2 + b^2)*(4 + n)*Hypergeometric2
F1[2, 3 + n, 4 + n, -((a*Cot[e + f*x])/b)])))/(b^2*(a^2 + b^2)^2*f*(3 + n)*(4 + n)))

________________________________________________________________________________________

Maple [F]
time = 2.60, size = 0, normalized size = 0.00 \[\int \frac {\left (d \cot \left (f x +e \right )\right )^{n}}{\left (a +b \tan \left (f x +e \right )\right )^{2}}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*cot(f*x+e))^n/(a+b*tan(f*x+e))^2,x)

[Out]

int((d*cot(f*x+e))^n/(a+b*tan(f*x+e))^2,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n/(a+b*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

integrate((d*cot(f*x + e))^n/(b*tan(f*x + e) + a)^2, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n/(a+b*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

integral((d*cot(f*x + e))^n/(b^2*tan(f*x + e)^2 + 2*a*b*tan(f*x + e) + a^2), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (d \cot {\left (e + f x \right )}\right )^{n}}{\left (a + b \tan {\left (e + f x \right )}\right )^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))**n/(a+b*tan(f*x+e))**2,x)

[Out]

Integral((d*cot(e + f*x))**n/(a + b*tan(e + f*x))**2, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n/(a+b*tan(f*x+e))^2,x, algorithm="giac")

[Out]

integrate((d*cot(f*x + e))^n/(b*tan(f*x + e) + a)^2, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (d\,\mathrm {cot}\left (e+f\,x\right )\right )}^n}{{\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^2} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*cot(e + f*x))^n/(a + b*tan(e + f*x))^2,x)

[Out]

int((d*cot(e + f*x))^n/(a + b*tan(e + f*x))^2, x)

________________________________________________________________________________________